package com.zr.daoimpl;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.zr.dao.ShowMyInfoDao;
import com.zr.model.Cuser;

@Repository("showMyInfoDao")
public class ShowMyInfoDaoImpl<T> extends BaseDaoImpl<T> implements ShowMyInfoDao<T>{

	@Override
	public List<Cuser> getMyInfoByUid(int page,int rows,int uid) {
		List<Cuser> us = new ArrayList<Cuser>();
		Cuser u = new Cuser();
		String hql = "from Cuser where uid = :uid";
		Query que = this.getCurrentSession().createQuery(hql);
		que.setFirstResult((page-1)*rows);
		que.setMaxResults(rows);
		que.setInteger("uid", uid);
		us = que.list();
		return us;
	}

}
